import type { TableColumn } from '@/components/core/dynamic-table';

export type TableListItem = API.UserListPageResultItem;
export type TableColumnItem = TableColumn<TableListItem>;

export const baseColumns: TableColumn[] = [
  {
    title: '关键字',
    align: 'left',
    dataIndex: 'keyword',
    hideInTable: true,
    formItemProps: {
      labelWidth: 55,
      componentProps: () => {
        return {
          placeholder: '可输入机构名称、简称搜索',
          disabledLabelWidth: true,
        };
      },
    },
  },
  {
    title: '机构名称',
    align: 'left',
    dataIndex: 'name',
    hideInSearch: true,
  },
  {
    title: '机构类型',
    align: 'left',
    dataIndex: 'type',
    hideInSearch: true,
  },
  {
    title: '机构简称',
    align: 'left',
    dataIndex: 'shortName',
    hideInSearch: true,
  },
  {
    title: '机构地址',
    align: 'left',
    dataIndex: 'address',
    hideInSearch: true,
  },
  {
    title: '数据类型',
    align: 'left',
    dataIndex: 'dataType',
    hideInSearch: true,
    customRender: ({ record }) => ['系统默认', '新增'][record.dataType - 1],
  },
];
